package com.sc.test.arouter;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;

/**
 * Created by Shen Chao
 * Created by 2019-02-11
 */
@Interceptor(priority = 1)
public class UseIInterceptor1 implements IInterceptor {

    @Override
    public void init(Context context) {
        MessageBean.setMessage("拦截器1 init:");
        Log.d("-----", "UseIInterceptor1 拦截器1 init:");
    }

    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        String threadName = Thread.currentThread().getName();
        MessageBean.setMessage("拦截器1开始执行, 线程：" + threadName);
        Log.d("-----", "UseIInterceptor1 拦截器1开始执行, 线程：" + threadName);
        callback.onContinue(postcard);
    }
}
